<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // var now = new Date()
        // document.write(now)
        // var future = new Date('2023/12/2')
        // console.log(future);


        var date = new Date('2022/12/23')
        // console.log(date.getFullYear());
        // console.log(date.getMonth()+1);
        // console.log(date.getDate());
        // console.log(date.getDay());//返回的是数字，星期一到星期六是1-6，星期天是0，可以放在数组里
         var year = date.getFullYear()
         var month = date.getMonth()
         var dates = date.getDate()
         var day = date.getDay()
         var arr = ['星期天','星期一','星期二','星期三','星期四','星期五','星期六']
         var week = arr[day]
         console.log(`今天是${year}年${month}月${dates}日 ${week}`);


    </script>
</body>
</html>